import React from 'react';
import { Table, Tag } from 'antd';
export default function ToduListTb(props) {
  // 表格配置
  const config = [
    {
      title: '标题',
      dataIndex: 'title',
      align: 'center',
    },
    {
      title: '日期',
      dataIndex: 'email',
      align: 'center',
    },
    {
      title: '优先级',
      dataIndex: 'priority',
      align: 'center',
      render: (_, record) => (
        <Tag
          color={
            record.priority === 1
              ? 'red'
              : record.priority === 2
              ? 'blue'
              : record.priority === 3
              ? 'gold'
              : ''
          }
        >
          {record.priority}
        </Tag>
      ),
    },
  ];
  return <Table bordered columns={config} dataSource={props.dataList} />;
}
